<script type="text/javascript">
function submitForm(action) {
    $(".submit").click(function(){
        if ("" == $.trim($("#adname").val())) {
            popup.error("广告名称不能为空");
            return false;
        }
        if ('create' == action && "" == $.trim($("#tagname").val())) {
            popup.error("广告标识不能为空");
            return false;
        }

        var url = ('create' == action) ? "{:U('create')}" : "{:U('update')}";


        commonAjaxSubmit(url);
        return false;
    });
}
</script>
